package com.numberone.master.modules.sys.web;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.numberone.master.modules.oa.dao.WorkOrderDao;
import com.numberone.master.modules.oa.entity.WorkOrder;



@Controller
@RequestMapping(value = "${adminPath}/sys/workOrderTest")
public class WorkOrderTestController {
	
	@Autowired
	private WorkOrderDao workOrderDao;
	
	@RequestMapping(value = {"index"})
	public String index() {
		return "modules/sys/workOrder";
	}
	
	@ResponseBody
	@RequestMapping(value = "getwo")
	public String getWorkOrder(WorkOrder wo) throws Exception {
		/*@SuppressWarnings("unchecked")
		Map<String, String[]> formData = request.getParameterMap();
		
		WorkOrder wo = new WorkOrder();
		float f;
		f=Float.parseFloat(formData.get("balance")[0]);
		
		@SuppressWarnings("deprecation")
		Date date = new Date(formData.get("date")[0]);
		
		Integer type = new Integer(formData.get("type")[0]);
		
		
		wo.setType(type);
		wo.setPhoto(formData.get("photo")[0]);
		wo.setName(formData.get("name")[0]);
		wo.setBalance(f);
		wo.setDescribed(formData.get("described")[0]);
		wo.setDate(date);*/
		
		System.out.println(wo);
		
		workOrderDao.insert(wo);
		
		return "001";
		
	}

}
